/*
 * Copyright 2025 arisgo@163.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.arisgo.cloud.attendance.clazz.mapper;

import com.arisgo.cloud.attendance.clazz.entity.StaffClass;
import com.arisgo.cloud.attendance.clazz.vo.ClassInfoDetailVo;
import com.arisgo.cloud.attendance.clazz.vo.StaffClassVo;
import com.arisgo.cloud.attendance.clazz.vo.StaffClassDetailVo;
import com.arisgo.cloud.attendance.clazz.vo.StaffVo;
import com.mybatisflex.core.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @author Coulson
 * @since 2024-12-31
 */
@Mapper
public interface StaffClassMapper extends BaseMapper<StaffClass> {

    void removeByClassId(@Param("tenantId") Long tenantId, @Param("classId") Long classId);

    void deleteByClassInfoIds(@Param("tenantId") Long tenantId, @Param("classInfoIds") List<Long> classInfoIds);

    Long pageStaffClassCount(Map<String, Object> params);

    List<StaffVo> pageStaffClass(Map<String, Object> params);

    List<StaffClassDetailVo> findStaffClassDetail(@Param("tenantId") Long tenantId, @Param("start") LocalDate start,
                                                  @Param("end") LocalDate end, @Param("staffIds") List<Long> staffIds);


    void deleteClassStaff(@Param("tenantId") Long tenantId, @Param("classIds") List<Long> classIds, @Param("staffIds") List<Long> staffIds);

    List<ClassInfoDetailVo> findClassByStaff(@Param("tenantId") Long tenantId, @Param("staffId") Long staffId, @Param("date") LocalDate date);

    List<StaffClassVo> findStaffByClassId(Map<String, Object> params);
}
